#! /usr/bin/env ruby

require 'test/unit'
require_relative 'libarbidice'

class TestDie < Test::Unit::TestCase
	def test_digits
		d6 = Die.new (1..6).to_a
		assert d6.sides.include? d6.roll
	end
	
	def test_strings
		dAnimals = Die.new ["ant", "bear", "cat", "dog"]
		assert dAnimals.sides.include? dAnimals.roll
	end
end

class TestTray < Test::Unit::TestCase
	def test_2d6
		tray = Tray.new '2d6'
		rolls = tray.roll[:rolls]
		assert rolls.all?{|roll| roll.between? 2, 12}
	end
	
	def test_modifier
		tray = Tray.new '3d1+5'
		assert_equal 8, tray.roll[:total]
	end
end

